package 力扣._283_移动0;

public class Solution {
    public void moveZeroes(int[] nums) {
        int zero_num = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == 0)
                zero_num++;
            else
                nums[i - zero_num] = nums[i];
        }
        for (; zero_num > 0; zero_num--) {
            nums[nums.length - zero_num] = 0;
        }
    }
}
